//
//  ViewController.swift
//  JXUtilsDemo
//
//  Created by Zhu Jinxin on 2018/11/7.
//  Copyright © 2018 Zhu Jinxin. All rights reserved.
//

import UIKit

class ViewController: UIViewController,UITextFieldDelegate{
    @IBAction func btn1(_ sender: UIButton) {
        let a  = UIAlertController.alertWith(title: "111", message: "222" , style: .actionSheet, cancelTitle: "123", OkTitle: nil, CancelActionHandle: { (alet) in
            print("11112233")
        }, OkActionHandle: nil)
        
        self.present(a, animated: true, completion: nil)
    }
    
    @IBOutlet weak var green: UIView!
    override func viewDidLoad() {
        super.viewDidLoad()
        
        myTF.delegate = self
  
        
    }

    @IBOutlet weak var myTF: UITextField!
    
    func textField(_ textField: UITextField, shouldChangeCharactersIn range: NSRange, replacementString string: String) -> Bool {
        
        String.settingTextField(textField, textLength: 3) { (string) -> Bool in
            return true
        }
        
     return true
    }
    

}



func test1(){
    
    let clsName = NSStringFromClass(JXExt.self)
    print(clsName) // -> JXUtilsDemo.JXExt
    
    let cls = NSClassFromString("JXUtilsDemo.JXExt") as? JXExt
    
    print(type(of: cls))
    
    JXExt.randomIntNumber(lower: 0, upper: 100)
    
    for _ in 0...10{
        print(JXExt.randomIntNumber(range: 2..<10))
    }
    
    
}
